<template>
  <div class="mdjyxjlBox">
    <!-------------------- 码垛机操作记录 -------------------->
    <TableHeader
      :data="{
        mainTitle: '码垛机操作记录',
        date: '2021年12月12日',
        company: '青岛崂山矿泉水有限公司',
        code: 'LK-QF-LS1-10-012-11-01',
      }"
    />
    <!-- <lb-table
      :column="tableData1.column"
      border
      :data="tableData1.data"
      highlight-current-row
    >
    </lb-table> -->
    <!-- <TableHeader
      :data="{
        subTitle: '停 机 及 维 修 记 录',
      }"
    /> -->
    <lb-table
      border
      :data="tableData2"
      :merge="[]"
    >
    </lb-table>
    <TableHeader
      :data="{
        subTitle: '岗 位 自 检 情 况',
      }"
    />
    <RowColTable border :data="tableData3" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData1: {
        column: [
          {
            prop: "value0",
            label: "产品名称",
            align: "center",
            // fixed: true,
            // // width: '120',
            // renderHeader: (h, scope) => {
            //   return <span>{scope.column.label}</span>;
            // },
          },
          {
            label: "开机时间",
            align: "center",
            prop: "value",
          },
          {
            label: "停机时间",
            align: "center",
            prop: "value",
          },
          {
            label: "PET瓶损耗数量",
            align: "center",
            prop: "value",
          },
          {
            prop: "value",
            align: "center",
            label: "瓶盖损耗数量",
          },
        ],
        data: [],
      },
      tableData2: {
        column: [
          {
            prop: "value",
            label: "产品名称",
            align: "center",
          },
          {
            prop: "value",
            label: "开机时间",
            align: "center",
          },
          {
            label: "停机时间",
            align: "center",
            prop: "value",
          },
          {
            label: "产量(箱/包)",
            align: "center",
            prop: "value",
          },
            {
            label: "纸箱/膜损耗数量",
            align: "center",
            prop: "value",
          },
          {
            label: "机速",
            align: "center",
            prop: "value",
          },
        ],
        data: [],
      },
      tableData3: {
        type: [
          { value: "date", label: "检查项目" },
          { value: "date", label: "时间" },
        ],
        column: [
          {
            prop: "value",
            label: "缺瓶检查",
          },
          {
            prop: "value",
            label: "包装质量",
          },
          {
            prop: "value",
            label: "纸箱/彩膜条码",
          },
        ],
        data: [
          {
            date: "2012-12-12",
            value:121313,
          },
        ],
      },
    };
  },
  created() {
    for (let i = 0; i < 4; i++) {
      this.tableData1.data.push({
        value:2342523,
      });
      this.tableData2.data.push({
        value:1231241
      });
      this.tableData3.data.push({
        date: "2012-12-12",
        value:3123131,
      });
    }
  },
  methods: {
    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
      // console.log(row, column, rowIndex, columnIndex);
      if (rowIndex % 2 === 0) {
        if (columnIndex === 0) {
          // return [2, 2];
        }
      }
      // if (rowIndex === 0) {
      if (columnIndex <= 0) {
        return [1, 2];
      }
      // }
    },
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {
        if (rowIndex % 2 === 0) {
          return {
            rowspan: 2,
            colspan: 1,
          };
        } else {
          return {
            rowspan: 0,
            colspan: 0,
          };
        }
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.mdjyxjlBox {
  width: 100%;
  // background: red;
}
</style>>

